using System;

namespace Be.Timvw.Framework.Domain.Specifications
{
    public class PredicateSpecification<T> : ISpecification<T>
    {
        private readonly Predicate<T> predicate;

        public PredicateSpecification(Predicate<T> predicate)
        {
            this.predicate = predicate;
        }

        #region ISpecification<T> Members

        public bool IsSatisfiedBy(T item)
        {
            return this.predicate(item);
        }

        #endregion
    }
}